package com.zlcode.waiter.controller;

import com.zlcode.waiter.model.WaiterInfo;
import jakarta.websocket.server.PathParam;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/waiter")
@Slf4j
public class WaiterController {

    @RequestMapping("/up/{content}")
    public String up(@PathVariable("content") String content) {
        log.info("正在执行: " + content);
        return "执行: " + content + "成功!";
    }

    @RequestMapping("/get-info")
    public WaiterInfo getInfo(String name) {
        WaiterInfo waiterInfo = new WaiterInfo();
        waiterInfo.setWaiterId(1111);
        waiterInfo.setWaiterName(name);
        return waiterInfo;
    }
}